package com.explorati.design_pattern.behavior.command;

import java.util.ArrayList;
import java.util.List;

/**
 * 调用者(Invoker)：该角色负责调用命令对象执行请求
 * 
 * @author explorati
 *
 */
public class Staff {

	private List<Command> commandList = new ArrayList<>();

	public void addCommand(Command command) {
		commandList.add(command);
	}

	public void executeCommands() {
		for (Command command : commandList) {
			command.execute();
		}
		commandList.clear();
	}
}
